/*
 * Copyright (c) 2020-2099 the original author or authors. All rights reserve.
 */
package org.tianyun.cloud.datasource.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 数据源路由Annotation
 *
 * @auther ebert_chan
 */
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface RoutingWith {

    /**
     * 数据源名称，默认的数据源名称：commonDataSource
     *
     * @return
     * @auther ebert_chan
     * @see org.tianyun.cloud.datasource.autoconfigure.DataSourceAutoConfiguration#COMMON_DATASOURCE_NAME
     */
    String value() default "";

    /**
     * 使用从库，默认false：不使用
     *
     * @return
     * @auther ebert_chan
     */
    boolean slave() default false;

}
